projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
880a3cc
)
x86: Add processor functions to halt and get stack pointer
author
Simon Glass
<
[email protected]
>
Tue, 11 Nov 2014 01:00:24 +0000
(18:00 -0700)
committer
Simon Glass
<
[email protected]
>
Fri, 21 Nov 2014 06:24:12 +0000
(07:24 +0100)
Add a function to get the stack pointer and another to halt the CPU.
Signed-off-by: Simon Glass <
[email protected]
>
Reviewed-by: Bin Meng <
[email protected]
>
arch/x86/include/asm/processor.h
patch
|
blob
|
history
diff --git
a/arch/x86/include/asm/processor.h
b/arch/x86/include/asm/processor.h
index bb3172ff91a447e5103d066c825495914b788d2d..b2854a978ab1903a38caa313e9ffeb61292530ee 100644
(file)
--- a/
arch/x86/include/asm/processor.h
+++ b/
arch/x86/include/asm/processor.h
@@
-30,4
+30,23
@@
enum {
#define X86_GDT_SIZE (X86_GDT_NUM_ENTRIES * X86_GDT_ENTRY_SIZE)
+#ifndef __ASSEMBLY__
+
+static inline __attribute__((always_inline)) void cpu_hlt(void)
+{
+ asm("hlt");
+}
+
+static inline ulong cpu_get_sp(void)
+{
+ ulong result;
+
+ asm volatile(
+ "mov %%esp, %%eax"
+ : "=a" (result));
+ return result;
+}
+
+#endif /* __ASSEMBLY__ */
+
#endif